 /*
select *
from pos_vip_info 
where vip_type in ('1218-VIP', 'ML-VIP') and (accu_amt<>0 or cur_vip_pts<>0)
*/
begin tran

declare @upd_id int 
select @upd_id = convert(int, var_data) 
from igs_parm with(updlock) where var_name = 'gv_upd_id'

declare @vip_no nvarchar(20)

declare cu cursor for  
select vip_no
from pos_vip_info 
where vip_type not in ('VIP-SL','VIP-GD','VIP-WG','M-VIP') and ( cur_vip_pts<>0)
open cu

fetch cu into @vip_no
while @@fetch_status = 0
begin
	exec sp_pos_recal_vip_pts @vip_no, @upd_id                                                      

fetch cu into @vip_no
end

close cu
deallocate cu

select vip_no
from pos_vip_info 
where vip_type not in ('VIP-SL','VIP-GD','VIP-WG','M-VIP') and ( cur_vip_pts<>0)
commit  tran

--select * from pos_sales_hdr where vip_no in ('85200014067')